﻿using AutoMapper;
using Domain.Entity.Config;
using Domain.Repository.IConfig;
using Microsoft.AspNetCore.Mvc;

namespace UI.Controllers
{
    public class CPCController : Controller
    {
        private readonly IConfig_public_charRepository cPCAppService;
        private readonly IMapper mapper;

        public CPCController(IConfig_public_charRepository cPCAppService, IMapper mapper)
        {
            this.cPCAppService = cPCAppService;
            this.mapper = mapper;
        }
        public IActionResult Index()
        {
            return View();
        }

        public async Task<IActionResult> DeleteCPC(int id)
        {
            int i=await cPCAppService.DeleteEIAsync(id);
            return Json(i);
        }

        public async Task<IActionResult> GetGetCM()
        {
            List<Config_public_char> cpc = await cPCAppService.GetCPCAttributeKindAsync("职称");
            return Json(cpc);
        }
    }
}
